

function getUsernameList(){
	$.get("UsernameList",function(data){
		var users =data.split(",");
		var dom=users.join("<br>");
		$("#usernameList").html(dom);
	},"text");
}

function getMessage(){
	$.get("ChatMessage",function(data){
		var messages =data.split("||");
		var dom=messages.join("<br>");
		$("#message").html(dom);
	},"html");
}
function doall(){
	getUsernameList();
	getMessage();
}
$(document).ready(function(){
	doall();
});

function back(){
	window.location="Login.html";
}

function sendChat(){
/*	var u=$.cookie("loginuser");*/
	var content =$("#chat").val();
	$.get("SendMessage","message=:"+content,function(data){
		$("#chat").val("");
		/*$("#message").html($("#message").html()+"<br>"+content+"<br>");*/
	});
}
setInterval(doall,500);